package com.le.tester.book.effectivejava3rdchinese.articlefiftyeight;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * createTime：2022/9/2 11:02
 * description：变量不会在循环中改变，导致循环的结果不正确
 */
public class EnumDemoSpotBug {
    enum Suit {CLUB, DIAMOND, HEART, SPADE}

    enum Rank {ACE, DEUCE, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING}


    public static void main(String[] args) {
        List<Suit> suitList = Arrays.asList(Suit.values());

        List<Rank> rankList = Arrays.asList(Rank.values());

        List<String> cardList = new ArrayList<>();
        for (Iterator<Suit> i = suitList.iterator(); i.hasNext(); ) {
            for (Iterator<Rank> j = rankList.iterator(); j.hasNext(); ) {
//                cardList.add(i.next(), j.next());
            }
        }
    }
}
